using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace RiceShop.Models
{
    /// <summary>
    /// 角色实体类
    /// </summary>
    [Table("Roles")]  // 修改表名为 Roles
    public class Role
    {
        /// <summary>
        /// 角色ID - 主键
        /// </summary>
        [Key]
        [Column("roleId")]
        public long roleId { get; set; }

        /// <summary>
        /// 角色名称 - 必填字段
        /// 最大长度256个字符
        /// </summary>
        [Required]
        [Column("roleName")]
        [StringLength(256)]
        public string roleName { get; set; } = string.Empty;

        /// <summary>
        /// 角色标准化名称
        /// 用于不区分大小写的角色查找
        /// 最大长度256个字符
        /// </summary>
        [Column("roleNormalizedName")]
        [StringLength(256)]
        public string? roleNormalizedName { get; set; }

        /// <summary>
        /// 并发标记
        /// 用于处理并发冲突
        /// </summary>
        [Column("roleConcurrencyStamp")]
        [MaxLength]
        public string? roleConcurrencyStamp { get; set; }
    }
}
